package com.huarui.company.dao;

import java.util.List;
import java.util.Map;

import org.ewaf.framework.dao.IBaseDao;
import org.ewaf.framework.model.PagingSummary;

import com.huarui.company.model.Company;
import com.huarui.company.model.CompanyMarket;

public interface ICompanyDao extends IBaseDao {

	boolean isExistCompanyByTaxCode(String taxCode);

	boolean isExistCompanyByCode(String code);

	boolean isExistCompanyByName(String name);

	boolean isExistCompanyByEmail(String email);

	boolean isExistCompanyByCreatorId(Integer creatorId);

	boolean isExistCompanyByActivateCode(String activateCode);

	Company getCompanyByName(String name);
	
	List<Company> getByContactorIdentityCode(String contactorIdentityCode,Integer paid);

	Company getCompanyByTaxCode(String taxCode,Integer paid);
	
	List<Company> getCompanyLikeTaxCode(String taxCode);

	List<Company> getLikeContactorIdentityCode(String contactorIdentityCode);
	
	Company getCompanyByIdWithCreator(Integer id);

	Company getCompanyByCode(String code);

	Company getCompanyByEmail(String email);

	Company getCompanyByPYCode(String pyCode);

	Company getCompanyByCreatorId(Integer creatorId);

	Company getCompanyByActivateCode(String activateCode);

	List<Map<String, Object>> getCompanysByPYCodePrefix(String PYCodePrefix,
			PagingSummary summary);

	int getCompanysCountByPYCodePrefix(String PYCodePrefix);

	@SuppressWarnings("unchecked")
	List<Company> getCompanysByword(Map map);

	public boolean updateCompany(Company company);

	public Company getBySimpleId(Integer id);
	
	/**
	 * 根据公司Id获得相关市场
	 * @param compId
	 * @return
	 */
	public List<CompanyMarket> getCompanyMarketsByCompId(Integer compId);

	Integer getCompanyCountByConditions(Map<String, Object> map);

	List<Company> getCompanyByConditions(Map<String, Object> map);
	
	public Company getCompanyByIdForUpdate(Integer id);
}
